//
//  UIView+UserObject.m
//  MobileCRM
//
//  Created by winter on 16/3/7.
//  Copyright © 2016年 江苏金恒信息科技有限公司. All rights reserved.
//

#import "UIView+UserObject.h"
#import <objc/runtime.h>

char const *userObjectKey = "userObjectKey";

@implementation UIView(UserObject)
- (void)setUserObject:(id)userObject
{
    objc_setAssociatedObject(self, userObjectKey, userObject, OBJC_ASSOCIATION_COPY_NONATOMIC);
}

- (id)getUserObject
{
    return objc_getAssociatedObject(self, userObjectKey);
}
- (void)removeUserObject
{
    id obj = [self getUserObject];
    if(obj)
        objc_removeAssociatedObjects(obj);
}
@end
